﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x020000B1 RID: 177
	public class TIfStmt : TCustomSqlStatement
	{
		// Token: 0x06000596 RID: 1430 RVA: 0x002FD2FF File Offset: 0x002FB4FF
		public void setElsifStmts(TStatementListSqlNode l)
		{
			this.ElsifStmts = l;
		}

		// Token: 0x06000597 RID: 1431 RVA: 0x002FD308 File Offset: 0x002FB508
		public TIfStmt() : this(EDbVendor.dbvoracle)
		{
		}

		// Token: 0x06000598 RID: 1432 RVA: 0x002FD312 File Offset: 0x002FB512
		public TIfStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sst_ifstmt;
		}

		// Token: 0x06000599 RID: 1433 RVA: 0x002FD323 File Offset: 0x002FB523
		internal override void buildsql()
		{
		}

		// Token: 0x0600059A RID: 1434 RVA: 0x002FD325 File Offset: 0x002FB525
		internal override void clear()
		{
		}

		// Token: 0x0600059B RID: 1435 RVA: 0x002FD327 File Offset: 0x002FB527
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x0600059C RID: 1436 RVA: 0x002FD32E File Offset: 0x002FB52E
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x170000E0 RID: 224
		// (get) Token: 0x0600059D RID: 1437 RVA: 0x002FD330 File Offset: 0x002FB530
		// (set) Token: 0x0600059E RID: 1438 RVA: 0x002FD338 File Offset: 0x002FB538
		public virtual TExpression Condition
		{
			get
			{
				return this.condition;
			}
			set
			{
				this.condition = value;
			}
		}

		// Token: 0x170000E1 RID: 225
		// (get) Token: 0x0600059F RID: 1439 RVA: 0x002FD341 File Offset: 0x002FB541
		// (set) Token: 0x060005A0 RID: 1440 RVA: 0x002FD35C File Offset: 0x002FB55C
		public virtual TStatementList ElseifStatements
		{
			get
			{
				if (this.elseifStatements == null)
				{
					this.elseifStatements = new TStatementList();
				}
				return this.elseifStatements;
			}
			set
			{
				this.elseifStatements = value;
			}
		}

		// Token: 0x170000E2 RID: 226
		// (get) Token: 0x060005A1 RID: 1441 RVA: 0x002FD365 File Offset: 0x002FB565
		// (set) Token: 0x060005A2 RID: 1442 RVA: 0x002FD380 File Offset: 0x002FB580
		public virtual TStatementList ThenStatements
		{
			get
			{
				if (this.thenStatements == null)
				{
					this.thenStatements = new TStatementList();
				}
				return this.thenStatements;
			}
			set
			{
				this.thenStatements = value;
			}
		}

		// Token: 0x170000E3 RID: 227
		// (get) Token: 0x060005A3 RID: 1443 RVA: 0x002FD389 File Offset: 0x002FB589
		// (set) Token: 0x060005A4 RID: 1444 RVA: 0x002FD3A4 File Offset: 0x002FB5A4
		public virtual TStatementList ElseStatements
		{
			get
			{
				if (this.elseStatements == null)
				{
					this.elseStatements = new TStatementList();
				}
				return this.elseStatements;
			}
			set
			{
				this.elseStatements = value;
			}
		}

		// Token: 0x170000E4 RID: 228
		// (set) Token: 0x060005A5 RID: 1445 RVA: 0x002FD3AD File Offset: 0x002FB5AD
		public virtual TStatementListSqlNode ElsifStmts
		{
			set
			{
				this.elsifStmts = value;
			}
		}

		// Token: 0x060005A6 RID: 1446 RVA: 0x002FD3B6 File Offset: 0x002FB5B6
		public override void init(object arg1, object arg2, object arg3)
		{
			this.condition = (TExpression)arg1;
			this.thenStmts = (TStatementListSqlNode)arg2;
			this.elseStmts = (TStatementListSqlNode)arg3;
		}

		// Token: 0x060005A7 RID: 1447 RVA: 0x002FD3DC File Offset: 0x002FB5DC
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			base.doParseStatement(psql);
			this.condition.doParse(this, ESqlClause.unknown);
			this.thenStmts.doParse(this, ESqlClause.unknown);
			for (int i = 0; i < this.thenStmts.size(); i++)
			{
				this.ThenStatements.add(this.thenStmts.getStatementSqlNode(i).Stmt);
			}
			if (this.elsifStmts != null)
			{
				this.elsifStmts.doParse(this, ESqlClause.unknown);
				for (int j = 0; j < this.elsifStmts.size(); j++)
				{
					this.ElseifStatements.add(this.elsifStmts.getStatementSqlNode(j).Stmt);
				}
			}
			if (this.elseStmts != null)
			{
				this.elseStmts.doParse(this, ESqlClause.unknown);
				for (int k = 0; k < this.elseStmts.size(); k++)
				{
					this.ElseStatements.add(this.elseStmts.getStatementSqlNode(k).Stmt);
				}
			}
			return 0;
		}

		// Token: 0x060005A8 RID: 1448 RVA: 0x002FD4CC File Offset: 0x002FB6CC
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060005A9 RID: 1449 RVA: 0x002FD4DC File Offset: 0x002FB6DC
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.condition.acceptChildren(v);
			this.ThenStatements.acceptChildren(v);
			if (this.elseifStatements != null)
			{
				this.elseifStatements.acceptChildren(v);
			}
			if (this.elseStatements != null)
			{
				this.elseStatements.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x0400114C RID: 4428
		private TExpression condition;

		// Token: 0x0400114D RID: 4429
		private TStatementListSqlNode thenStmts;

		// Token: 0x0400114E RID: 4430
		private TStatementListSqlNode elseStmts;

		// Token: 0x0400114F RID: 4431
		private TStatementListSqlNode elsifStmts;

		// Token: 0x04001150 RID: 4432
		private TStatementList elseifStatements;

		// Token: 0x04001151 RID: 4433
		private TStatementList thenStatements;

		// Token: 0x04001152 RID: 4434
		private TStatementList elseStatements;
	}
}
